package com.industrial.premu.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.industrial.common.core.utils.StringUtils;
import com.industrial.common.core.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.industrial.common.log.annotation.Log;
import com.industrial.common.log.enums.BusinessType;
import com.industrial.common.security.annotation.RequiresPermissions;
import com.industrial.premu.domain.PreMuBenefitEvaluationAppeal;
import com.industrial.premu.service.IPreMuBenefitEvaluationAppealService;
import com.industrial.common.core.web.controller.BaseController;
import com.industrial.common.core.web.domain.AjaxResult;
import com.industrial.common.core.utils.poi.ExcelUtil;
import com.industrial.common.core.web.page.TableDataInfo;

/**
 * 企业数据申诉-状态Controller
 * 
 * @author zhous
 * @date 2024-01-26
 */
@RestController
@RequestMapping("/appeal")
public class PreMuBenefitEvaluationAppealController extends BaseController
{
    @Autowired
    private IPreMuBenefitEvaluationAppealService preMuBenefitEvaluationAppealService;

    /**
     * 查询企业数据申诉-状态列表
     */
    @RequiresPermissions("premu:appeal:list")
    @GetMapping("/list")
    public TableDataInfo list(PreMuBenefitEvaluationAppeal preMuBenefitEvaluationAppeal)
    {

        startPage();
        List<PreMuBenefitEvaluationAppeal> list = preMuBenefitEvaluationAppealService.selectPreMuBenefitEvaluationAppealList(preMuBenefitEvaluationAppeal);
        return getDataTable(list);
    }

    /**
     * 导出企业数据申诉-状态列表
     */
    @RequiresPermissions("premu:appeal:export")
    @Log(title = "企业数据申诉-状态", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, PreMuBenefitEvaluationAppeal preMuBenefitEvaluationAppeal)
    {
        List<PreMuBenefitEvaluationAppeal> list = preMuBenefitEvaluationAppealService.selectPreMuBenefitEvaluationAppealList(preMuBenefitEvaluationAppeal);
        ExcelUtil<PreMuBenefitEvaluationAppeal> util = new ExcelUtil<PreMuBenefitEvaluationAppeal>(PreMuBenefitEvaluationAppeal.class);
        util.exportExcel(response, list, "企业数据申诉-状态数据");
    }

    /**
     * 获取企业数据申诉-状态详细信息
     */
    @RequiresPermissions("premu:appeal:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(preMuBenefitEvaluationAppealService.selectPreMuBenefitEvaluationAppealById(id));
    }

    /**
     * 新增企业数据申诉-状态
     */
    @RequiresPermissions("premu:appeal:add")
    @Log(title = "企业数据申诉-状态", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody PreMuBenefitEvaluationAppeal preMuBenefitEvaluationAppeal)
    {
        return toAjax(preMuBenefitEvaluationAppealService.insertPreMuBenefitEvaluationAppeal(preMuBenefitEvaluationAppeal));
    }

    /**
     * 修改企业数据申诉-状态
     */
    @RequiresPermissions("premu:appeal:edit")
    @Log(title = "企业数据申诉-状态", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody PreMuBenefitEvaluationAppeal preMuBenefitEvaluationAppeal)
    {
        return toAjax(preMuBenefitEvaluationAppealService.updatePreMuBenefitEvaluationAppeal(preMuBenefitEvaluationAppeal));
    }

    /**
     * 删除企业数据申诉-状态
     */
    @RequiresPermissions("premu:appeal:remove")
    @Log(title = "企业数据申诉-状态", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(preMuBenefitEvaluationAppealService.deletePreMuBenefitEvaluationAppealByIds(ids));
    }

}
